<?php
class blog_post_view extends SClass {

    public function process() {
        $user = $this->getUserSecure();
        if ($user) {
            if ($user->getLevel() >= 1) {
        	   $this->assign('autorized', 1);
            }
        }
        $post = ServiceUtils::GetFactory()->getBlogService()->getPostByID(
            $this->getArgument('id'));
        $this->assign('title', $post->getTitle());
        $this->assign('content', $post->getContent());
        $this->assign('postdate', $post->getPostdate());
        $this->assign('user', ServiceUtils::GetFactory()->getUserService()->getUserByID(
            $post->getUserid())->getName());
        $this->assign('urledit', Engine_LinkMaker::GetURLByContentID(
            'blog_post_edit', $post->getId()));
        $this->assign('urldelete', Engine_LinkMaker::GetURLByContentID(
            'blog_post_delete', $post->getId()));
    }

}